//
//  GPVideoToolView.h
//  Keping
//
//  Created by 23 on 2017/12/10.
//  Copyright © 2017年 柯平. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "KLVideoCallButton.h"

typedef NS_ENUM(NSInteger, GPVideoViewStatus) {
    GPVideoViewStatusCalling        = 1000,     //主叫(本人发起通话时的界面)
    GPVideoViewStatusCalled         = 1001,     //被叫(对方发起呼叫，本人显示的界面)
    GPVideoViewStatusVideoSession   = 1002,     //通话中的界面(视频)
    GPVideoViewStatusVoiceSession   = 1003,     //通话中的界面(音频)
    
};

@class GPVideoToolView;

@protocol GPVideoToolViewDelegate <NSObject>

#pragma mark - 未接通状态
//主叫 -- 取消主叫
- (void)toolView:(GPVideoToolView *)toolView status:(GPVideoViewStatus)status didCancelCalling:(KLVideoCallButton *)cancelButton;
//被叫 -- 拒绝接听
- (void)toolView:(GPVideoToolView *)toolView status:(GPVideoViewStatus)status didRejectCalled:(KLVideoCallButton *)rejectButton;
//被叫 -- 接听通话
- (void)toolView:(GPVideoToolView *)toolView status:(GPVideoViewStatus)status didReceiveCalled:(KLVideoCallButton *)receiveButton;

#pragma mark - 接通状态
//通话中 -- 主动挂断
- (void)toolView:(GPVideoToolView *)toolView status:(GPVideoViewStatus)status didHangupSession:(KLVideoCallButton *)hangupButton;
//通话中 -- 视频 -- 切换前后摄像头
- (void)toolView:(GPVideoToolView *)toolView status:(GPVideoViewStatus)status didChangeCamera:(KLVideoCallButton *)changeButton;
//通话中 -- 视频 -- 切换成语音聊天
- (void)toolView:(GPVideoToolView *)toolView status:(GPVideoViewStatus)status didSwitchToVoice:(KLVideoCallButton *)switchButton;
//通话中 -- 语音 -- 静音
- (void)toolView:(GPVideoToolView *)toolView status:(GPVideoViewStatus)status didSlienceVoice:(KLVideoCallButton *)slienceButton isSlience:(BOOL)isSlience;
//通话中 -- 语音 -- 免提
- (void)toolView:(GPVideoToolView *)toolView status:(GPVideoViewStatus)status didHandsOff:(KLVideoCallButton *)handsOffButton ishandsOff:(BOOL)isHandsOff;

@end



@interface GPVideoToolView : UIView


/**
 根据状态加载view

 @param status 状态
 @return 回调
 */
+ (instancetype)toolViewWithStatus:(GPVideoViewStatus)status;

/**根据状态切换UI*/
- (void)updateUIWithStatus:(GPVideoViewStatus )status;

/**delegate*/
@property(nonatomic,weak) id <GPVideoToolViewDelegate> delegate;

@end
